/**
 * Framework for batch testing user profile models
 * Final project by Sergey Nepomnyachiy and Julia Polchin
 * Supervisor: Tsvi Kuflik
 *
 */
package models.content;

import static org.junit.Assert.assertTrue;

import java.io.File;
import java.util.Collection;
import java.util.Iterator;
import java.util.Vector;

import org.junit.Test;

import core.environment.fVector;
import core.generators.CSVGenerator;

/**
 * @author Sergey and Julia
 * 
 */
public class TestFacade {

	public static Collection<Object> convertVector(Vector<?> userRatings) {
		Vector<Object> rates = new Vector<Object>(userRatings.size());
		for (Object d : userRatings)
			rates.add(d);
		return rates;
	}
	
	/**
	 * 
	 */
	@SuppressWarnings( { "unchecked", "boxing" })
	@Test
	public void stressTest() {
		File file = new File("tfsSmall.csv");
		CSVGenerator csv = new CSVGenerator(file);

		Facade facade = new Facade(0);
		facade.setK(9);

		Collection<?> matrix = csv.getVector();
		Iterator<?> it = matrix.iterator();
		
		for (int i = 0; i < 19; ++i) {
			fVector v = (fVector) it.next();
			facade.trainDoc(v);
		}
		
		

		System.out.println(facade.predictCategory((fVector) it.next()));
	}

}
